package week03.single;

/**
 * Created by zhangxiaokun on 2018/2/8.
 */
public class Singleton01 {
    private static Singleton01 instance = new Singleton01();    //第一次加载时执行
    private Singleton01() {
        System.out.println("...Singleton01 is create");
    }

    public static Singleton01 getInstance() {
        return instance;
    }

    public static void axx() {  //用于测试观察 实例是否延迟加载
        System.out.println("--Singleton01.axx() run...");
    }


    public  Integer id = 1;
    public static String name = "aaaa";

    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }

    public  String getName() {
        return name;
    }
    public  void setName(String name) {
        Singleton01.name = name;
    }
}
